@extends('layouts.app')
@include('crowd.sidebar')
@section('content')
    <div class="content">
        <div class="row custom-invoice">
            <a class="btn btn-success" href="{{ route("admin.crowd.good.create") }}">添加礼包</a>
            <br />
            <br />
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>商品名</th>
{{--                    <th>所属商铺</th>--}}
                    <th>价格</th>
                    <th>众筹数</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $item)
                    <tr>
                        <td>{{ $item->name }}</td>
{{--                        <td>{{ $shop->get($item->shop_id)->name }}</td>--}}
                        <td>{{ $item->price/100 }}</td>
                        <td>{{ $item->crowd }}</td>
                        <td>{{ \App\Modules\Crowd\Models\CrowdGood::$showStatus[$item->status] }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="{{ route('admin.crowd.good.edit', ['id' => $item->id]) }}"><i class="fa fa-edit"></i> 编辑</a>
                            @if($item->status == \App\Modules\Good\Models\Good::STATUE_OFF)
                                <a class="btn btn-primary btn-xs" href="{{ route('admin.crowd.good.status', ['id' => $item->id]) }}"><i class="fa fa-circle-o-notch"></i> 上架</a>
{{--                            @else--}}
{{--                                <a class="btn btn-primary btn-sm" href="{{ route('admin.crowd.good.status', ['id' => $item->id]) }}"><i class="fa fa-ban"></i> 下架</a>--}}
                            @endif
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            {{ $data->links() }}
        </div>
    </div>
@endsection
